package com.zebra.remoting.config;

import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @Date 2019/8/26 0026
 **/
@Data
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class RegisterConnectMessage extends ZebraBaseMessage<RegisterConnectMessage> {

    private int serverId;
    private int serverType;

    @Override
    public void write(ByteBuf b) {
        writeInt(b, serverId);
        writeInt(b, serverType);
    }

    @Override
    public RegisterConnectMessage read(ByteBuf b) {
        RegisterConnectMessage message = new RegisterConnectMessage();
        message.serverId = readInt(b);
        message.serverType = readInt(b);
        return message;
    }
}
